home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS05.ADF
/
text
/
gameport
< prev
next >
Wrap
Text File
|
1986-01-15
|
17KB
|
437 lines
Game Controller Interface Connector Specification
--------------------------------------------------
The two 9 pin D with pins (male) type connectors at the right of the
Amiga nearer the front are used to interface to four types of devices:
1. Mouse or trackball, 3 buttons max
2. Digital Joystick, 2 buttons max
3. Proportional (pot or proportional joystick), 2 buttons max
4. Light Pen, including pen-pressed-to-screen button
The connector pin assignments will be discussed in sections organized by
similar hardware and/or software operating requirements as shown in the
previous list. Signal names will follow those used in the appendices of
the hardware manual when possible.
J11 is the right controller port connector (joy1dat, pot1dat).
J12 is the left controller port connector (joy0dat, pot0dat).
NOTE: While most of the following hardware discussed is directly
accessable, hardware should be accessed through ROM kernal software.
This will keep future hardware changes transparent to the user.
Game Controller Interface to Mouse/Trackball Quadrature Inputs
----------------------------------------------------------------
A mouse or trackball is a device that translates planar motion into
pulse trains. Quadrature techniques are employed to preserve the
direction as well as magnitude of displacement. The registers joy0dat
and joy1dat become counter registers, with y displacement in the high
byte and x in the low byte. Movement causes the following action:
up: y decrements
down: y increments
right: x increments
left: x decrements
To determine displacement, joyxdat is read twice with corresponding x
and y values subtracted (careful, modulo 128 arithmetic). Note that if
either count changes by more than 127, both distance and direction become
ambiguous. There is a relationship between the sampling interval and the
maximum speed (i.e. change in distance) that can be resolved as follows:
Velocity < Distance(max) / SampleTime
Velocity < SQRT(DeltaX**2 + DeltaY**2) / SampleTime
For an Amiga with a 200 count per inch mouse sampling during each
vertical blanking interval, the maximum velocity in either the X or Y
direction becomes:
Velocity < (128 Counts * 1 inch/200 Counts) / .017 sec = 38 in/sec
which should be sufficient for most users.
NOTE: The Amiga software is designed to do mouse update cycles during
vertical blanking. The horizontal and vertical counters are always
valid and may be read at any time.
Connector Pin Usage for Mouse/Trackball Quadrature Inputs
-----------------------------------------------------------
pin mnuemonic description hardware register/notes
1 V Vertical Pulses joy[0/1]dat<15:8>
2 H Horiontal Pulses joy[0/1]dat(7:0>
3 VQ Vertical Quadrature Pulses joy[0/1]dat<15:8>
4 HQ Horizontal Quadrature Pulses joy[0/1]dat<7:0>
5 UBUT* Unused Mouse Button See Proportional Inputs
6 LBUT* Left Mouse Button See Fire Button
7 +5V 125ma max, 200ma surge total both ports
8 Ground
9 RBUT* Right Mouse Button See Proportional Inputs
Game Port Interface to Digital Joysticks
--------------------------------------------------
A joystick is a device with 4 normally opened switches arranged 90
degrees apart. The joy[0/1]dat registers become encoded switch input ports
as follows:
forward: bit#9 xor bit#8
left: bit#9
back: bit#1 xor bit#0
right: bit#1
Data is encoded to facilitate the mouse/trackball operating mode.
NOTE: The right and left direction inputs are also designed to be
right and left buttons, respectively, for use with proportional
inputs. In this case, the forward and back inputs are not used,
while right and left become button inputs rather than joystick inputs.
The joy[0/1]dat registers are always valid and may be read at any time.
Connector Pin Usage for Digital Joystick Inputs
--------------------------------------------------
pin mnuemonic description hardware register/notes
1 FORWARD* Forward Joystick Switch joy[0/1]dat<9 xor 8>
2 BACK* Back Joystick Switch joy[0/1]dat(1 xor 0>
3 LEFT* Left Joystick Switch joy[0/1]dat<9>
4 RIGHT* Right Joystick Switch joy[0/1]dat<1>
5 unused
6 FIRE* Left Mouse Button See Fire Button
7 +5V 125ma max, 200ma surge total both ports
8 Ground
9 unused
Game Port Interface to Fire Buttons
--------------------------------------------------
The fire buttons are normally opened switches routed to the 8520
adapter PRA0 as follows:
PRA0 bit 7 = Fire* Left Controller Port
PRA0 bit 6 = Fire* Right Controller Port
Before reading this register, the corresponding bits of the data
direction register must be cleared to define input mode:
DDRA0<7:6> cleared as appropriate
NOTE: Do not disturb the settings of other bits in DDRA0 (Use of ROM
kernal calls is recommended).
Fire button are always valid and may be read at any time.
Connector Pin Usage for Fire Button Inputs
--------------------------------------------------
pin mnuemonic description
1 -x-
2 -x-
3 -x-
4 -x-
5 -x-
6 FIRE* Left Mouse Button/Fire Button
7 -x-
8 -x-
9 -x-
Game Port Interface to Proportional Controllers
-------------------------------------------------------
Resistive (potentiometer) element linear taper proportional controllers
are supported up to 528k Ohms max (470k +/- 10% recommended). The
joy[0/1]dat registers contain digital translation values for y in the high
byte and x in the low byte. A higher count value indicates a higher
external resistance. The Amiga performs an intergrating analog to
digital conversion as follows:
1. Pot[0/1]dat registers are reset and the analog input capacitors are
discharged for the first 7 (261 lines) or 8 (262 lines) horizontal
lines.
2. Once per horizontal line, each analog input is compared to an
internal reference.
3. Any counter whose analog input exceeds the reference stops incrementing.
The counter is stopped for the duration of the veritcal frame.
4. Any counter whose analog input is less than the reference continues
to increment.
NOTE: The POTY and POTX inputs are designated as Right Mouse Button and
Unused Mouse button respectively. An opened switch corresponds to
high resistance, a closed switch to a low resistance. The buttons
are also available in potgo and potinp registers. It is
recommended that ROM kernal call be used for future hardware
compatability.
The pot[0/1]dat registers are typically read during video blanking, but
MAY be available prior to that.
Connector Pin Usage for Proportional Inputs
--------------------------------------------------
pin mnuemonic description hardware register/notes
1 unused
2 unused
3 LBUT* Left Button See Digital Joystick
4 RBUT* Right Button See Digital Joystick
5 POTX X Analog In pot[0/1]dat<7:0>, potgo, potinp
6 unused
7 +5V 125ma max, 200 ma surge
8 Ground
9 POTY Y Analog In pot[0,1]dat<15:8>, potgo, potinp
Game Port Interface to Light Pen
--------------------------------------------------
A light pen is an optoelectronic device whose light sensitive portion
is placed in proximity to a CRT. As the electron beam sweeps past the
light pen, a trigger pulse is generated which can be enabled to latch the
horizontal and vertical beam positions. There is no hardware bit to
indicate this trigger, but this can be determined in the two ways shown
in the Hardware Manual.
Light pen position is usually read during blanking, but MAY be available
prior to that.
Connector Pin Usage for Light Pen Inputs
--------------------------------------------------
pin mnuemonic description hardware register/notes
1 unused
2 unused
3 unused
4 unused
5 LPENPR* Light Pen Pressed See Propotional Inputs
6 LPENTG* Light Pen Trigger vposr, vhposr
7 +5V 125ma max, 200 ma surge both ports
8 Ground
9 unused
Game Controller Interface Connector Specification
--------------------------------------------------
The two 9 pin D with pins (male) type connectors at the right of the
Amiga nearer the front are used to interface to four types of devices:
1. Mouse or trackball, 3 buttons max
2. Digital Joystick, 2 buttons max
3. Proportional (pot or proportional joystick), 2 buttons max
4. Light Pen, including pen-pressed-to-screen button
The connector pin assignments will be discussed in sections organized by
similar hardware and/or software operating requirements as shown in the
previous list. Signal names will follow those used in the appendices of
the hardware manual when possible.
J11 is the right controller port connector (joy1dat, pot1dat).
J12 is the left controller port connector (joy0dat, pot0dat).
NOTE: While most of the following hardware discussed is directly
accessable, hardware should be accessed through ROM kernal software.
This will keep future hardware changes transparent to the user.
Game Controller Interface to Mouse/Trackball Quadrature Inputs
----------------------------------------------------------------
A mouse or trackball is a device that translates planar motion into
pulse trains. Quadrature techniques are employed to preserve the
direction as well as magnitude of displacement. The registers joy0dat
and joy1dat become counter registers, with y displacement in the high
byte and x in the low byte. Movement causes the following action:
up: y decrements
down: y increments
right: x increments
left: x decrements
To determine displacement, joyxdat is read twice with corresponding x
and y values subtracted (careful, modulo 128 arithmetic). Note that if
either count changes by more than 127, both distance and direction become
ambiguous. There is a relationship between the sampling interval and the
maximum speed (i.e. change in distance) that can be resolved as follows:
Velocity < Distance(max) / SampleTime
Velocity < SQRT(DeltaX**2 + DeltaY**2) / SampleTime
For an Amiga with a 200 count per inch mouse sampling during each
vertical blanking interval, the maximum velocity in either the X or Y
direction becomes:
Velocity < (128 Counts * 1 inch/200 Counts) / .017 sec = 38 in/sec
which should be sufficient for most users.
NOTE: The Amiga software is designed to do mouse update cycles during
vertical blanking. The horizontal and vertical counters are always
valid and may be read at any time.
Connector Pin Usage for Mouse/Trackball Quadrature Inputs
-----------------------------------------------------------
pin mnuemonic description hardware register/notes
1 V Vertical Pulses joy[0/1]dat<15:8>
2 H Horiontal Pulses joy[0/1]dat(7:0>
3 VQ Vertical Quadrature Pulses joy[0/1]dat<15:8>
4 HQ Horizontal Quadrature Pulses joy[0/1]dat<7:0>
5 UBUT* Unused Mouse Button See Proportional Inputs
6 LBUT* Left Mouse Button See Fire Button
7 +5V 125ma max, 200ma surge total both ports
8 Ground
9 RBUT* Right Mouse Button See Proportional Inputs
Game Port Interface to Digital Joysticks
--------------------------------------------------
A joystick is a device with 4 normally opened switches arranged 90
degrees apart. The joy[0/1]dat registers become encoded switch input ports
as follows:
forward: bit#9 xor bit#8
left: bit#9
back: bit#1 xor bit#0
right: bit#1
Data is encoded to facilitate the mouse/trackball operating mode.
NOTE: The right and left direction inputs are also designed to be
right and left buttons, respectively, for use with proportional
inputs. In this case, the forward and back inputs are not used,
while right and left become button inputs rather than joystick inputs.
The joy[0/1]dat registers are always valid and may be read at any time.
Connector Pin Usage for Digital Joystick Inputs
--------------------------------------------------
pin mnuemonic description hardware register/notes
1 FORWARD* Forward Joystick Switch joy[0/1]dat<9 xor 8>
2 BACK* Back Joystick Switch joy[0/1]dat(1 xor 0>
3 LEFT* Left Joystick Switch joy[0/1]dat<9>
4 RIGHT* Right Joystick Switch joy[0/1]dat<1>
5 unused
6 FIRE* Left Mouse Button See Fire Button
7 +5V 125ma max, 200ma surge total both ports
8 Ground
9 unused
Game Port Interface to Fire Buttons
--------------------------------------------------
The fire buttons are normally opened switches routed to the 8520
adapter PRA0 as follows:
PRA0 bit 7 = Fire* Left Controller Port
PRA0 bit 6 = Fire* Right Controller Port
Before reading this register, the corresponding bits of the data
direction register must be cleared to define input mode:
DDRA0<7:6> cleared as appropriate
NOTE: Do not disturb the settings of other bits in DDRA0 (Use of ROM
kernal calls is recommended).
Fire button are always valid and may be read at any time.
Connector Pin Usage for Fire Button Inputs
--------------------------------------------------
pin mnuemonic description
1 -x-
2 -x-
3 -x-
4 -x-
5 -x-
6 FIRE* Left Mouse Button/Fire Button
7 -x-
8 -x-
9 -x-
Game Port Interface to Proportional Controllers
-------------------------------------------------------
Resistive (potentiometer) element linear taper proportional controllers
are supported up to 528k Ohms max (470k +/- 10% recommended). The
joy[0/1]dat registers contain digital translation values for y in the high
byte and x in the low byte. A higher count value indicates a higher
external resistance. The Amiga performs an intergrating analog to
digital conversion as follows:
1. Pot[0/1]dat registers are reset and the analog input capacitors are
discharged for the first 7 (261 lines) or 8 (262 lines) horizontal
lines.
2. Once per horizontal line, each analog input is compared to an
internal reference.
3. Any counter whose analog input exceeds the reference stops incrementing.
The counter is stopped for the duration of the veritcal frame.
4. Any counter whose analog input is less than the reference continues
to increment.
NOTE: The POTY and POTX inputs are designated as Right Mouse Button and
Unused Mouse button respectively. An opened switch corresponds to
high resistance, a closed switch to a low resistance. The buttons
are also available in potgo and potinp registers. It is
recommended that ROM kernal call be used for future hardware
compatability.
The pot[0/1]dat registers are typically read during video blanking, but
MAY be available prior to that.
Connector Pin Usage for Proportional Inputs
--------------------------------------------------
pin mnuemonic description hardware register/notes
1 unused
2 unused
3 LBUT* Left Button See Digital Joystick
4 RBUT* Right Button See Digital Joystick
5 POTX X Analog In pot[0/1]dat<7:0>, potgo, potinp
6 unused
7 +5V 125ma max, 200 ma surge
8 Ground
9 POTY Y Analog In pot[0,1]dat<15:8>, potgo, potinp
Game Port Interface to Light Pen
--------------------------------------------------
A light pen is an optoelectronic device whose light sensitive portion
is placed in proximity to a CRT. As the electron beam sweeps past the
light pen, a trigger pulse is generated which can be enabled to latch the
horizontal and vertical beam positions. There is no hardware bit to
indicate this trigger, but this can be determined in the two ways shown
in the Hardware Manual.
Light pen position is usually read during blanking, but MAY be available
prior to that.
Connector Pin Usage for Light Pen Inputs
--------------------------------------------------
pin mnuemonic description hardware register/notes
1 unused
2 unused
3 unused
4 unused
5 LPENPR* Light Pen Pressed See Propotional Inputs
6 LPENTG* Light Pen Trigger vposr, vhposr
7 +5V 125ma max, 200 ma surge both ports
8 Ground
9 unused